package com.rfid.emergencywarehouse.fragment;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.rfid.base.base.BaseListFragment;
import com.rfid.emergencywarehouse.R;
import com.rfid.emergencywarehouse.adapter.OrderAdapter;
import com.rfid.emergencywarehouse.entity.BarcodeInfo;
import com.rfid.emergencywarehouse.entity.Order;
import com.rfid.emergencywarehouse.presenter.ShelfingWithOrderPresenter;
import com.rfid.emergencywarehouse.view.IOnShelfWithOrderView;

import java.util.List;

public class OrderListFragment extends BaseListFragment<OrderAdapter, Order, ShelfingWithOrderPresenter>implements IOnShelfWithOrderView {

    @Override
    protected OrderAdapter getAdapter() {
        return new OrderAdapter(mData);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("上架单列表");
    }

    @Override
    public void onResume() {
        super.onResume();
        System.out.println("onResume");
        mPresenter.getOrderList();
    }

    @Override
    protected int getRecyclerViewId() {
        return R.id.recyclerView;
    }

    @Override
    public ShelfingWithOrderPresenter getPresenter() {
        return new ShelfingWithOrderPresenter();
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_order_list;
    }

    @Override
    public void onBarcode(String rfid, String barcode) {
    }

    @Override
    public void onBarcodeQuery(BarcodeInfo info,boolean success) {
    }

    @Override
    public void onOrderList(List<Order> orders) {
        setData(orders);
    }

    @Override
    public void onKuwei(String shelf) {
    }

    @Override
    public void onScanStatus(boolean scan) {
    }

    @Override
    public void onShelfingResult(boolean succes, String msg) {
    }
}
